package lagou.homework.lagou_homework_rocketmq.repository;

import lagou.homework.lagou_homework_rocketmq.entity.Seckill;
import lagou.homework.lagou_homework_rocketmq.entity.SeckillVo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SeckillVoRepository extends JpaRepository<SeckillVo,String> {

    @Query(nativeQuery = true,value = "select * from seckill where seckill.startTime<=now() and seckill.endTime>=now()")
    public List<SeckillVo> loadSeckillVoList();
}
